package com.city.utils;

/**
 * @author 雷楚桥
 * @deprecation 校验码助手函数
 * @email leichuqiao@126.com
 * @date 2018/7/21 15:19
 */
public class CheckCodeUtils {

    /**
     * @return String
     * @deprecation 得到一个校验码
     * @params length Integer 随机码长度
     * @author 雷楚桥
     * @date 2018/7/21 15:20
     */
    public static String getCheckCode(Integer length) {
        StringBuilder code = new StringBuilder();
        while (length-- > 0) {
            code.append((int) (Math.random() * 10));
        }
        return code.toString();
    }

//    public static void main(String args[]){
//        String res = "{\"typeBig\":\"1\",\"gis\":\"105.241291,28.31865\",\"files\":{\"1533707584672-0\":\"http://192.168.127.134:2020/images/2018-08-07/s7qLPUwIkHbPb6icyQJzsiqmmxs2yZWjbao.jpg\",\"1533707582474-0\":\"http://192.168.127.134:2020/images/2018-08-07/ft0r3Ml9Xb2oLZK9XwMx0Vi1GPHIfYTqDub.gif\"},\"townId\":\"1\",\"title\":\"百分点个\",\"villageId\":\"2\",\"categoryId\":6,\"content\":\"<p style=\\\"text-align: center;\\\">fds&nbsp;<\\/p>\"}";
//        JSONObject json = new JSONObject(res);
//        String gis = (String)json.get("gis");
//        String ga[] = gis.split(",");
//        System.out.println(ga.length);
//        for(String g : ga){
//            Double r = Double.valueOf(g);
//            System.out.println(r + 1.00001);
//        }
//    }
}
